package main

import "fmt"

func main() {
	slice1 := make([]float32, 0)    //长度为0的切片
	slice2 := make([]float32, 3, 5) // [0 0 0] 长度为3容量为5的切片

	fmt.Println(len(slice1), cap(slice1))
	fmt.Println(len(slice2), cap(slice2))

	slice2 = append(slice2, 1, 2, 3, 4) //[0, 0, 0, 1, 2, 3, 4]
	fmt.Println(len(slice2), cap(slice2))

	sub1 := slice2[3:]
	sub2 := slice2[:3]
	sub3 := slice2[1:4]

	fmt.Println(sub1, sub2, sub3)

	slice3 := make([]float32,7,12)
	copy(slice3,slice2)
	fmt.Println(slice3)
}
